package com.jessica.school;

public class Student {
    int id;
    String name;
    boolean isClassCadre;
    int mathScore;
    int chineseScore;
    int englishScore;

    public Student(int id, String name, boolean isClassCadre, int mathScore, int chineseScore, int englishScore) {
        this.id = id;
        this.name = name;
        this.isClassCadre = isClassCadre;
        this.mathScore = mathScore;
        this.chineseScore = chineseScore;
        this.englishScore = englishScore;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setClassCadre(boolean classCadre) {
        isClassCadre = classCadre;
    }

    public void setMathScore(int mathScore) {
        this.mathScore = mathScore;
    }

    public void setChineseScore(int chineseScore) {
        this.chineseScore = chineseScore;
    }

    public void setEnglishScore(int englishScore) {
        this.englishScore = englishScore;
    }

    @Override
    public String toString() {
        return id + ", " + name + ", isClassCadre=" + isClassCadre +
                ", math: " + mathScore +
                ", chn: " + chineseScore +
                ", eng: " + englishScore;
    }

    public int calcTotalScore() {
        return this.mathScore + this.chineseScore + this.englishScore;
    }

    public int averageScore() {
        return this.calcTotalScore() / 3;
    }

    public static void main(String[] args) {
        Student lily = new Student(12345, "Lily", true, 93, 94, 95);
        System.out.println(lily);
        System.out.println("Their total score is: " + lily.calcTotalScore());
        System.out.println("Their average score is: " + lily.averageScore());
    }
}
